<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:o="http://openfaces.org/"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<head>
</head>
<body>
	<ui:composition template="/templates/skeleton.xhtml">
		<ui:define name="listing">
			<ui:include src="list.xhtml" />
		</ui:define>
		<ui:define name="display">
		
			<h:outputText value="#{navController.breadcrumbTrail}" />
		
	        <h1>#{msg.residencyEdit}</h1>
	        <h:messages id="errors" globalOnly="true"/>
	        <h:form>
	            <h:panelGrid columns="4">
	            		<h:outputText value="#{msg.individualId}:"/>
	            		<h:outputText />
	                	<h:inputText styleClass="individual" autocomplete="off" id="indiv" value="#{residencyCrud.item.individual}" 
	                		title="Individual #" converter="#{individualExtIdConverter}" disabled="true" />
	            		<h:message for="indiv" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.locationId}:"/>
                        <h:outputText />
                        <h:inputText styleClass="location" autocomplete="off" id="loc" value="#{residencyCrud.item.location}" converter="#{locationExtIdConverter}" />
                        <h:message for="loc" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.residencyStartDate}:"/>
                        <h:outputText />
                        <h:inputText id="startDate" value="#{residencyCrud.item.startDate}" styleClass="date demo_jqui" converter="#{calendarConverter}" />
                        <h:message for="startDate" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	                    <h:outputText value="#{msg.residencyStartType}:"/>
	                    <img class="clickable" onclick="O$('popupWindowForResidencyStartTypeCodes').showCentered();" src="#{request.contextPath}/resources/images/question.png" />
	                    <h:inputText id="startType1" value="#{residencyCrud.item.startType}" converter="#{residencyStartTypeCodesConverter}" />
	                    <h:message for="startType1" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

                        <h:outputText value="#{msg.residencyEndDate}:"/>
                        <h:outputText />
                        <h:inputText id="endDate" value="#{residencyCrud.item.endDate}" styleClass="date demo_jqui" converter="#{calendarConverter}" />
                        <h:message for="endDate" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>

	                    <h:outputText value="#{msg.residencyEndType}:"/>
	                    <img class="clickable" onclick="O$('popupWindowForResidencyEndTypeCodes').showCentered();" src="#{request.contextPath}/resources/images/question.png" />
	                    <h:inputText id="endType1" value="#{residencyCrud.item.endType}" converter="#{residencyEndTypeCodesConverter}" />
	                    <h:message for="endType1" errorClass="error" errorStyle="color: red" infoStyle="color: green"/>
                    </h:panelGrid>
                    <br />
                    <h:commandButton disabled="true" action="#{residencyCrud.edit}" value="#{msg.lblSave}"/>
                </h:form>
			    <script>
					$(".individual").autocomplete({source:"#{request.contextPath}/individual.autocomplete"});
				</script>
		</ui:define>
	</ui:composition>
  </body>
</html>
